package com.ayu.chatroom.service;

import com.ayu.chatroom.entity.Users;
import com.ayu.chatroom.entity.vo.MyFriendVo;
import com.ayu.chatroom.entity.vo.UserVo;
import com.ayu.chatroom.util.R;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ayu
 * @since 2022-10-10
 */
public interface UsersService extends IService<Users> {


    /**
     * 根据用户名筛选用户
     * @param username username
     * @return 用户
     */
    Users selectByUsername(String username);


    /**
     * 登陆或者注册
     * @param username username
     * @param password password
     * @param cid cid
     * @return 用户信息
     */
    UserVo registerOrLogin(String username, String password,String cid);

    /**
     * 上传头像
     * @param userId userId
     * @param faceData faceData
     * @return 上传头像
     */
    Users uploadFaceBase64(String userId,String faceData);

    /**
     * 查询好友
     * @param myUserId
     * @param friendUserName
     * @return
     */
    R searchFriend(String myUserId, String friendUserName);


    /**
     * 处理好友请求
     * @param acceptUserId acceptUserId
     * @param sendUserId sendUserId
     * @param operType operType
     * @return 好友列表
     */
    List<MyFriendVo> operFriendRequest(String acceptUserId,String sendUserId,Integer operType);


}
